﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="answer.aspx.cs" Inherits="Admin_answer" Title="Answers Management" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <center>            
        <asp:Button ID="cmdChooseQues" runat="server"  
            Text="Choose Question" Height="30px" onclick="cmdChooseQues_Click" />
        </center>
    <asp:Panel ID="Panel1" CssClass="panel" runat="server">
        <div class="row">
            <div class="left">ID:</div>
            <div class="right"><asp:TextBox ID="txtId" runat="server" Width="50px" 
                    Enabled="False" ></asp:TextBox></div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Question:</div>
            <div class="right">
                <asp:TextBox ID="txtQues" runat="server" Width="350px" 
                    Enabled="False" Height="80px" TextMode="MultiLine"></asp:TextBox>
            </div>
        </div>
        <div class="clear"></div>
          <div class="row">
            <div class="left">Question Type:</div>
            <div class="right">
                <asp:DropDownList ID="DropDownList1" runat="server" Width="350px">
                    <asp:ListItem Value="-1">Please select...</asp:ListItem>
                </asp:DropDownList>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left"></div>
            <div class="right" style="margin:10px 0px">
                <asp:Button ID="cmdChoose" runat="server" Text="Choose this Question" 
                    onclick="cmdChoose_Click" Height="30px" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cmdHide" runat="server" Text="Hide" onclick="cmdHide_Click" 
                    Height="30px" />
            </div>
        </div>
        <div class="clear"></div>
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server">
    
    <div style="text-align:center;margin:10px;font-weight:bold;font-size:18px;">
        <asp:Label ID="lblInfo" runat="server" Text="Please choose question first"></asp:Label>
    </div> 
        <asp:GridView ID="GridView1" runat="server" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="6" 
        ForeColor="Black" GridLines="Horizontal" AllowPaging="True" 
        AutoGenerateColumns="False" Width="700px" DataKeyNames="id" onrowediting="GridView1_RowEditing" 
        onpageindexchanging="GridView1_PageIndexChanging" HorizontalAlign="Center">
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" />
            <asp:BoundField DataField="question" HeaderText="Questions" />
            <asp:BoundField DataField="type" HeaderText="Type" />
            <asp:CommandField EditImageUrl="~/images/Admin/information.png" HeaderText="View" 
                ShowEditButton="True" ButtonType="Image" >
                <ItemStyle Font-Underline="True" HorizontalAlign="Center" Width="40px" />
            </asp:CommandField>
        </Columns>
        <PagerStyle BackColor="#99CCFF" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    </asp:GridView>

     </asp:Panel>
     
     <asp:Panel ID="Panel3" CssClass="panel" runat="server">
        <div class="row">
            <div class="left" style="margin:5px 0px">Question:</div>
            <div class="right" style="margin:5px 0px"><asp:Label ID="lblQuestionAnswer" style="font-weight:bold;" runat="server"></asp:Label>
            <asp:TextBox ID="txtQuestionIdAnswer" runat="server" Width="50px" Visible = "false" ></asp:TextBox>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Answer ID:</div>
            <div class="right"><asp:TextBox ID="txtAnswerId" runat="server" Width="50px"></asp:TextBox></div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left">Answer:</div>
            <div class="right"><asp:TextBox ID="txtAnswer" runat="server" Width="350px"></asp:TextBox>
                <asp:Label ID="lblAnswerError" runat="server" ForeColor="Red" Text="Not null" 
                    Visible="False"></asp:Label>
            </div>
        </div>
        <div class="clear"></div>
        <div class="row">
            <div class="left"></div>
            <div class="right">
                <asp:Button ID="cmdAddAnswer" runat="server" Text="Add" 
                    onclick="cmdAddAnswer_Click"/>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cmdClearAnswer" runat="server" Text="Clear" 
                    onclick="cmdClearAnswer_Click"/>
            </div>
        </div>
        <div class="clear"></div>
    </asp:Panel>
    <asp:Panel ID="Panel4" runat="server">
        <asp:GridView ID="GridView2" runat="server" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="6" 
        ForeColor="Black" GridLines="Horizontal" AllowPaging="True" 
        AutoGenerateColumns="False" Width="700px" DataKeyNames="id" 
        onrowdeleting="GridView2_RowDeleting" onrowediting="GridView2_RowEditing" 
        onpageindexchanging="GridView2_PageIndexChanging" HorizontalAlign="Center">
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" />
            <asp:BoundField DataField="answer" HeaderText="Answer" />
            <asp:CommandField EditImageUrl="~/images/Admin/hammer_screwdriver.png" HeaderText="Edit" 
                ShowEditButton="True" ButtonType="Image" >
                <ItemStyle Font-Underline="True" HorizontalAlign="Center" Width="40px" />
            </asp:CommandField>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:Button ID="deleteButton" runat="server" CommandName="Delete" style="width:16px;height:16px;background:url(../images/Admin/cross.png);border:none;cursor:pointer;" OnClientClick="return confirm('Are you sure?');" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="40px" />
            </asp:TemplateField>
        </Columns>
        <PagerStyle BackColor="#99CCFF" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
    </asp:GridView>

     </asp:Panel>
</asp:Content>

